package com.satan.fmmall.handler;

import com.satan.fmmall.vo.ResCode;
import com.satan.fmmall.vo.ResultVo;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @ClassName AllExceptionHandler
 * @Description TODO
 * @date 2022/2/20 20:05
 * @Version 1.0
 */
@ControllerAdvice
public class AllExceptionHandler {
    //进行异常处理，处理Exception.class的异常
    @ExceptionHandler()
    @ResponseBody
    public ResultVo doException(Exception ex){
        ex.printStackTrace();
        return ResultVo.fail(ResCode.SYSTEM_ERRO);
    }

}
